<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <link rel="stylesheet" href="http://127.0.0.1:9999?error=link">
</head>
<body>
<h1 id="button">hello</h1>
<img src="http://127.0.0.1:9999?error=img" alt="">
<script>
  // console.log(123)
  // const ajax = new XMLHttpRequest()
  // ajax.open('PUT', 'http://127.0.0.1:9999')
  // ajax.send()
  button.addEventListener('click', ajax)
  const port = 9999
  const url = 'http://localhost:' + port + '/'
  function f() {
    fetch(url, {
      method: 'put'
    }).then(res => {
      return res.json()
    }).then(res => {
      console.log(res)
    })
  }
  function ajax() {
    const xhr = new XMLHttpRequest()
    xhr.open('DELETE', url, true)
    xhr.setRequestHeader('X-CCC', 'value')
    xhr.setRequestHeader('X-bbb', 'value2')
    xhr.send()
  }
</script>
</body>
</html>
